Functions in GMSEE.dll

To use the following functions in your Game Maker project, you can merge GMSEE.gm6 to your project, or you can define and call the functions with your own code, using external_define and external_call. Note that the following functions are the functions in GMSEE.dll, and not the GML scripts in GMSEE.gm6.

Init

Initializes the DLL. This function must be called before using any other functions.

function Init: Real; cdecl;

Returns: 1.

 

Free

Frees the memory used by the DLL. This function should be called when the DLL isn’t needed anymore.

function Free: Real; cdecl;

Returns: 1.

 

AddResource(FileName)

Loads a resource from the indicated .wav file. The wave file should be in PCM format, preferably 44.1 kHz 16-bit mono. The Sound data will be resampled to this format if necessary.

function AddResource(FileName: PChar): Real; cdecl;

Returns: The resource identifier on success or -1 on failure.

 

FreeResource(ResourceID)

Frees the indicated resource. This should be called if the resource is no longer needed.

function FreeResource(ResourceID: Real): Real; cdecl;

Returns: 1 on success, 0 on failure.

 

AddInstance(ResourceID)

Creates and initializes a sound instance, using the indicated resource. The sound will not start playing before you call Play or Loop.

function AddInstance(ResourceID: Real): Real; cdecl;

Returns: The instance identifier on succes or -1 on failure.

 

FreeInstance(InstanceID)

Frees the indicated instance. This should be called when the instance will not be used anymore.

function FreeInstance(InstanceID: Real): Real; cdecl;

Returns: 1 on success, 0 on failure.

 

Play(InstanceID)

Starts playing the indicated instance from its current position and disables looping. It will only play until it reaches the end of the sound.

function Play(InstanceID: Real): Real; cdecl;

Returns: 1 on success, 0 on failure.

 

Loop(InstanceID)

Start looping the indicated instance from its current position. It will play until it is freed or until Pause or Stop is called.

function Loop(InstanceID: Real): Real; cdecl;

Returns: 1 on success, 0 on failure.

 

Pause(InstanceID)

Pauses the indicated instance.

function Pause(InstanceID: Real): Real; cdecl;

Returns: 1 on success, 0 on failure.

 

Stop(InstanceID)

Stops the indicated instance and resets its position. Note that you can start playing an instance after having stopped it. You will need to call FreeInstance to remove the instance completely.

function Stop(InstanceID: Real): Real; cdecl;

Returns: 1 on success, 0 on failure.

 

SetFrequencyFactor(InstanceID, Value)

Sets how fast the indicated sound instance will play. 1 is the default speed. If the value is negative, the sound will play backwards, and the position will be set to the end of the data instead of the beginning when the instance is stopped.

function SetFrequencyFactor(InstanceID: Real; Value: Real): Real; cdecl;

Returns: 1 on success, 0 on failure.

 

SetVolume(InstanceID, Value)

Controls the volume of the indicated instance. The amplitude of the sound is multiplied by the indicated value. 1 (max) is the default value.

function SetVolume(InstanceID: Real; Value: Real): Real; cdecl;

Returns: 1 on success, 0 on failure.

 

SetPan(InstanceID, Value)

Controls the difference in the volume between left and right channel. -1 is left channel only, 0 is 100 % on both channels, 1 is right channel only, 0.6 is 40 % on left and 100 % on right etc.

function SetPan(InstanceID: Real; Value: Real): Real; cdecl;

Returns: 1 on success, 0 on failure.

 

SetPosition(InstanceID, Value)

Sets the data position of the indicated instance. 0 is at the beginning if the data,1 is at the end.

function SetPosition(InstanceID: Real; Value: Real): Real; cdecl;

Returns: 1 on success, 0 on failure.

 

IsPlaying(InstanceID)

Returns wether the instance is currently playing.

function IsPlaying(InstanceID: Real): Real; cdecl;

Returns: Wether playing (1) or not (0), or NaN on failure.

 

IsLooping(InstanceID)

Returns wether the instance loops when reaching the end of the sound. This may be true even when the sound is paused.

function IsLooping(InstanceID: Real): Real; cdecl;

Returns: Wether loop is enabled (1) or not (0), or NaN on failure.

 

GetFrequencyFactor(InstanceID)

Returns the playback speed of the indicated instance. See SetFrequencyFactor for more details.

function GetFrequencyFactor(InstanceID: Real): Real; cdecl;

Returns: The current playback speed, or NaN on failure.

 

GetVolume(InstanceID)

Returns the volume of the indicated instance. See SetVolume for more details.

function GetVolume(InstanceID: Real): Real; cdecl;

Returns: The current volume, or NaN on failure.

 

GetPan(InstanceID)

Returns the panning of the indicated instance. See SetPan for more details.

function GetPan(InstanceID: Real): Real; cdecl;

Returns: The current panning, or NaN on failure.

 

GetPosition(InstanceID)

Returns the data position of the indicated instance. See SetPosition for more details.

function GetPosition(InstanceID: Real): Real; cdecl;

Returns: The current data position, or NaN on failure.